package com.publiccms.common.base;

import static com.publiccms.common.tools.SiteUtils.CONTEXT_SITE_ID;

import org.springframework.beans.factory.annotation.Autowired;

import com.publiccms.logic.component.SiteComponent;
import com.sanluan.common.directive.BaseTemplateDirective;
import com.sanluan.common.handler.RenderHandler;

/**
 * 
 * AbstractTemplateDirective 自定义模板指令基类
 *
 */
public abstract class AbstractTemplateDirective extends BaseTemplateDirective {
    public int getSiteId(RenderHandler handler) throws Exception {
        return Integer.valueOf(handler.getAttribute(CONTEXT_SITE_ID));
    }

    @Autowired
    protected SiteComponent siteComponent;
}